<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<html lang="en">
<head>
<title>Portable Timeline Generator</title>
<link href="http://npr-simile-timeline.googlecode.com/svn/trunk/timeline.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript">
function getTopValue(){

if (parent.parent.generatorFrame.document.generatorForm.timelineHeight.value == "") {
	heightString=" height=\"" + "300" + "px\;";
} else {
	// heightString="height: " + parent.parent.generatorFrame.document.generatorForm.timelineHeight.value + "px\;";
	heightString=" height=\"" + parent.parent.generatorFrame.document.generatorForm.timelineHeight.value + "px\"";
}
	
if (parent.parent.generatorFrame.document.generatorForm.timelineWidth.value == "") {
	// widthString="width: 100%\""
	widthString=" width=\"100%\"";
} else {
	// widthString="width: " + parent.parent.generatorFrame.document.generatorForm.timelineWidth.value + "px\;\"";
	widthString=" width=\"" + parent.parent.generatorFrame.document.generatorForm.timelineWidth.value + "px\"";
}

link = "http:\/\/npr-simile-timeline.googlecode.com\/svn\/trunk\/widget.html?" + "http:\/\/api.npr.org\/query\?" + parent.parent.qgliteFrame.document.selectionForm.queryBox.value + "\&apiKey\=MDAxNzgwMDQ5MDEyMTQ4NzYyMjU4YmY1Yw004\&output\=JSON\&callback\=parseJSON";

iframe = "\<iframe src =\"" + link + "\"" + heightString + " width=\"100\%\" scrolling=\"No\" frameborder=\"0\"\>\<\/iframe\>";



// just in case I want to throw more into the code that is'nt part of the iframe
code = iframe;

document.codeForm.code.value = code;

document.codeForm.link.value = link;

}
</script>
</head>
<body onLoad="getTopValue();">
<form name="codeForm">
<h2>Code</h2>
<textarea id="code" rows="10" cols="50"></textarea>
<h2>Link</h2>
<textarea id="link" rows="10" cols="50"></textarea>
<p>Alternatively, you can copy the link above to send a timeline in email, or simply link to a timeline from a hyperlink.</p>
</form>
</body>
</html>